import request from '@/utils/request'

/** *
 * 获取角色列表
 * **/
export function getRoleListAPI(params) {
  return request({
    url: '/sys/role',
    params // 查询参数
  })
}

export function addRoleAPI(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}

export function updateRoleAPI(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}

/**
 * 获取角色详情
 * **/

export function getRoleDetailAPI(id) {
  return request({
    url: `/sys/role/${id}`
  })
}

export function assignPermAPI(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
